// 尚品汇
import http from '@/utils/http'
// 网易
import { IRecommList } from '@/types/home'
import { IChannelList } from '@/types/pdao'
import { IRecomm } from '@/types/recomm'
// 以下都是测试接口

// 测试网易
/**
 * @description 获取推荐列表数据
 * @returns
 */
export const reqRecomList = () => {
  return http<IRecommList>('/xhr/index.json', 'GET')
}
/**
 * @description 获取商品列表
 * @returns
 */
export const reqGoodsList = () => {
  return http('/xhr/index/items.json', 'GET')
}

/**
 * @description 获取某个频道
 * @returns
 */
export const reqOtherList = (categoryId: string) => {
  return http(`/item/list.json?categoryId=${categoryId}`, 'GET')
}

/**
 * @description 获取频道列表
 * @returns
 */

export const reqRecommList = () => {
  return http<IChannelList>('/item/cateList.json', 'GET')
}

/**
 * @description 为你推荐
 * 这个接口服务器内部不让使用
 *
 */

export const reqForYou = (params: IRcomForYou) => {
  return http<IRecomm>(
    '/xhr/index/items.json?csrf_token=e2b264bedb37d44764468c0f8bebdd88',
    'POST',
    params
  )
}
interface IRcomForYou {
  itemIdsStr: string
  size: number
}